﻿using System;
using System.Text;
using System.Drawing;
using System.Collections.Generic;

namespace Ex03.VehicalsObjectModel
{
    public abstract class PrivateCar : Vehical
    {
        // Members
        private const int k_MinNumOfDoors = 1;
        private Color m_CarColor;
        private int m_NumOfDoors;

        // Ctor

        /// <summary>
        /// Initializes the abstract private car
        /// </summary>
        /// <param name="i_LicenseNumber">The license number of the vehical</param>
        /// <param name="i_EnergySystem">The energy system of the vehical</param>
        /// <param name="i_CarColor">The color of the car</param>
        /// <param name="i_NumOfDoors">The number of doors in the car</param>
        /// <exception cref="FormatException">When the license number is malformed</exception>
        /// <exception cref="ArgumentException">Too small number of doors</exception>
        public PrivateCar(
            string i_LicenseNumber, 
            VehicalEnergySystem i_EnergySystem, 
            Color i_CarColor,
            int i_NumOfDoors) : base(i_LicenseNumber, i_EnergySystem)
        {
            if (i_NumOfDoors < k_MinNumOfDoors)
            {
                throw new ArgumentException(string.Format("Number of doors too small (minimum is {0})", k_MinNumOfDoors));
            }
            else
            {
                m_CarColor = i_CarColor;
                m_NumOfDoors = i_NumOfDoors;
            }
        }

        // Properties
        protected override int k_NumOfWheels
        {
            get
            {
                return 4;
            }
        }

        protected override float k_DefaultWheelsPSI
        {
            get
            {
                return 29;
            }
        }

        /// <summary>
        /// Gets the color of the car
        /// </summary>
        public Color CarColor
        {
            get
            {
                return m_CarColor;
            }
        }

        /// <summary>
        /// Returns the number of doors in the car
        /// </summary>
        public int NumOfDoors
        {
            get
            {
                return m_NumOfDoors;
            }
        }
    }
}
